﻿using System;
using System.Data.Linq.Mapping;

namespace BSU.GraduateWork.Data.Model
{
    [Table(Name = "Problem")]
    public class Problem3D: Problem
    {
        [Column(Name = "id", DbType = "Int IDENTITY", IsPrimaryKey = true, IsDbGenerated = true, 
            CanBeNull = false, AutoSync = AutoSync.OnInsert, UpdateCheck = UpdateCheck.Never)]
        public override int Id { get; set;}

        [Column(Name = "Type", DbType = "int", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public override ProblemType Type { get; set; }

        [Association(Name = "InputParameters_Problem", ThisKey = "InputParametersId", OtherKey = "Id", IsForeignKey = true)]
        public InputParameters3D InputParameters { get; set; }

        [Association(Name = "Solution_Problem", ThisKey = "SolutionId", OtherKey = "Id", IsForeignKey = true)]
        public Solution3D Solution { get; set; }

        [Column(Name = "InputParametersId", DbType = "Int", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        internal override int InputParametersId { get; set; }

        [Column(Name = "SolutionId", DbType = "Int", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        internal override int SolutionId { get; set; }

        [Column(Name = "ExactSolutionId", DbType = "Int", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        internal override int ExactSolutionId { get; set; }
    }
}
